package com.qd.pay.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 退款结果
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_order_refund_report")
public class OrderRefundReport extends Model<OrderRefundReport> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "rid", type = IdType.NONE)
    private String rid;
    /**
     * 支付系统订单号:微信订单号
     */
    @TableField("transaction_id")
    private String transactionId;
    /**
     * 商户退款单号
     */
    @TableField("out_refund_no")
    private String outRefundNo;
    /**
     * 商户订单号
     */
    @TableField("out_trade_no")
    private String outTradeNo;
    /**
     * 退款成功时间
     */
    @TableField("time_end")
    private LocalDateTime timeEnd;
    /**
     * 退款入账账户
     */
    @TableField("refund_recv_accout")
    private String refundRecvAccout;
    /**
     * 退款金额
     */
    @TableField("refund_fee")
    private BigDecimal refundFee;
    /**
     * 退款状态:1.调用支付接口返回的状态 ok.成功 cancel.用户取消 fail.失败
     */
    @TableField("refund_status")
    private String refundStatus;
    /**
     * 退款发起来源
     */
    @TableField("refund_request_source")
    private String refundRequestSource;
    /**
     * 写入时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 退款编号:从1开始
     */
    @TableField("refund_no")
    private Integer refundNo;
    /**
     * 订单ID
     */
    @TableField("order_id")
    private String orderId;

    public void freeData() {
        this.rid = null;
        this.transactionId = null;
        this.outRefundNo = null;
        this.outTradeNo = null;
        this.timeEnd = null;
        this.refundRecvAccout = null;
        this.refundFee = null;
        this.refundStatus = null;
        this.refundRequestSource = null;
        this.addTime = null;
        this.refundNo = null;
        this.orderId = null;
    }

}
